<?php
class IssueService extends Service{
    
    function __construct() {
        parent::__construct();
        $this->mDao = new IssueDao();
    }
    
    public function insertObject($obj){
        try {
            return $this->mDao->insertObject($obj);
            }
       
        catch (Exception $exc) {
            PageData::addModelError($exc->getMessage());
            throw new Exception($exc->getMessage());
        }
    
    }
    
    public function getList(){
            try {
                return $this->mDao->getList();
            } catch (Exception $exc) {
                PageData::addModelError($exc->getMessage());
            }

    }
    
    
     public function updateObject($obj, $old_id){
        try{
            $this->mDao->updateObject($obj, $old_id);
        }
         
        catch(Exception $exc){
            PageData::addModelError($exc->getMessage());
        }
        
     }

    public function deleteObject($id){
        try {
            $this->mDao->deleteObject($id);
            
        } catch (Exception $exc) {
            PageData::addModelError($exc->getMessage());
            $this->mDao->roolback();
        }
    }

    public function getObject($id){
        try {
            return $this->mDao->getObject($id);
        } catch (Exception $exc) {
            PageData::addModelError($exc->getMessage());
        }
    }

    public function updateStatus($status,$id){
        try {
            return $this->mDao->UpdateStatus($status,$id);
        } catch (Exception $exc) {
            PageData::addModelError($exc->getMessage());
        }
    }
    
    public function issueDetail(){
            try {
                return $this->mDao->issueDetail();
            } catch (Exception $exc) {
                PageData::addModelError($exc->getMessage());
            }
    }
    
    
}